package model;

import java.util.List;

public class Order {
    private int id;
    private List<Product> products;
    private double totalAmount;

    public Order() {
    }

    public int getId() {
        return this.id;
    }

    public List<Product> getProducts() {
        return this.products;
    }

    public double getTotalAmount() {
        return this.totalAmount;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setProducts(List<Product> products) {
        this.products = products;
    }

    public void setTotalAmount(double totalAmount) {
        this.totalAmount = totalAmount;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof Order)) {
            return false;
        } else {
            Order other = (Order)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (this.getId() != other.getId()) {
                return false;
            } else if (Double.compare(this.getTotalAmount(), other.getTotalAmount()) != 0) {
                return false;
            } else {
                Object this$products = this.getProducts();
                Object other$products = other.getProducts();
                if (this$products == null) {
                    if (other$products == null) {
                        return true;
                    }
                } else if (this$products.equals(other$products)) {
                    return true;
                }

                return false;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof Order;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        result = result * 59 + this.getId();
        long $totalAmount = Double.doubleToLongBits(this.getTotalAmount());
        result = result * 59 + (int)($totalAmount >>> 32 ^ $totalAmount);
        Object $products = this.getProducts();
        result = result * 59 + ($products == null ? 43 : $products.hashCode());
        return result;
    }

    public String toString() {
        int var10000 = this.getId();
        return "Order(id=" + var10000 + ", products=" + this.getProducts() + ", totalAmount=" + this.getTotalAmount() + ")";
    }
}
